docs: clarify that H.edges[idx] returns attributes, not members#727
Conversation
A common confusion is that H.edges[0] returns the empty attribute dict rather than the members of edge 0. The behavior is correct but the docstring did not point users at the actual member-access methods. Add an upfront note and concrete examples showing both attribute access and the alternatives (.members, .memberships). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
404b639 to
76e3e92
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #727 +/- ##
=======================================
Coverage 93.68% 93.68%
=======================================
Files 66 66
Lines 5207 5213 +6
=======================================
+ Hits 4878 4884 +6
Misses 329 329 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Great idea to clarify this, thanks Leo. |
H.nodes? and H.edges? are common discovery moves; surface the attr-vs-member distinction in the class docstrings where users will actually encounter it (per Max's review on #727). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Good point Max. Strictly speaking the Pushed a follow-up that also adds a short attr-vs-member note to the |
|
Great! |
|
Oops, this was merged into |
|
Sorry about that, totally my mistake — I missed the dev/main convention. Just retargeted #728 and #729 to dev, backmerged main into dev to recover the stranded commits, and opened #734 to document the workflow in CLAUDE.md so it doesn't happen again. Going to change the default branch to dev now so PRs target dev by default. |
Summary
A recurring point of confusion is that
H.edges[0]returns the (empty) attribute dict rather than the members of edge 0. The behavior is technically correct, but the docstring didn't direct users to the actual member-access methods.This PR keeps the behavior the same (per our v1.0 stance of hardening rather than changing the API) and improves the docstring:
See Alsopointing atEdgeView.membersandNodeView.membershipsTest plan
--doctest-modules)